/*    */ package server.life;
/*    */ 
/*    */ import client.MapleClient;
/*    */ import constants.GameConstants;
/*    */ import server.maps.MapleMapObjectType;
/*    */ import server.shop.MapleShopFactory;
/*    */ import tools.packet.NPCPacket;
/*    */ 
/*    */ public class MapleNPC
/*    */   extends AbstractLoadedMapleLife {
/*    */   private final int mapid;
/* 12 */   private String name = "MISSINGNO";
/*    */   private boolean custom = false;
/* 14 */   private int ownerid = 0;
/*    */   
/*    */   public MapleNPC(int id, String name, int mapid) {
/* 17 */     super(id);
/* 18 */     this.name = name;
/* 19 */     this.mapid = mapid;
/*    */   }
/*    */   
/*    */   public boolean hasShop() {
/* 23 */     return (MapleShopFactory.getInstance().getShopForNPC(getId()) != null);
/*    */   }
/*    */   
/*    */   public void sendShop(MapleClient c) {
/* 27 */     MapleShopFactory.getInstance().getShopForNPC(getId()).sendShop(c);
/*    */   }
/*    */ 
/*    */   
/*    */   public void sendSpawnData(MapleClient client) {
/* 32 */     if (getId() < 9901000 && getId() != 9000069 && getId() != 9000133) {
/* 33 */       client.announce(NPCPacket.spawnNPC(this));
/* 34 */       client.announce(NPCPacket.spawnNPCRequestController(this, true));
/*    */     } 
/*    */   }
/*    */ 
/*    */   
/*    */   public void sendDestroyData(MapleClient client) {
/* 40 */     client.announce(NPCPacket.removeNPC(getObjectId()));
/* 41 */     if (!isHidden() && !GameConstants.isHideNpc(client.getPlayer().getMapId(), getId())) {
/* 42 */       client.announce(NPCPacket.removeNPCController(getObjectId(), false));
/*    */     }
/*    */   }
/*    */ 
/*    */   
/*    */   public MapleMapObjectType getType() {
/* 48 */     return MapleMapObjectType.NPC;
/*    */   }
/*    */   
/*    */   public String getName() {
/* 52 */     return this.name;
/*    */   }
/*    */   
/*    */   public void setName(String n) {
/* 56 */     this.name = n;
/*    */   }
/*    */   
/*    */   public boolean isCustom() {
/* 60 */     return this.custom;
/*    */   }
/*    */   
/*    */   public void setCustom(boolean custom) {
/* 64 */     this.custom = custom;
/*    */   }
/*    */   
/*    */   public int getMapid() {
/* 68 */     return this.mapid;
/*    */   }
/*    */   
/*    */   public int getOwnerid() {
/* 72 */     return this.ownerid;
/*    */   }
/*    */   
/*    */   public void setOwnerid(int ownerid) {
/* 76 */     this.ownerid = ownerid;
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\server\life\MapleNPC.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */